import { S } from '../../s';
import { IPSAppViewEngine } from './ipsapp-view-engine';
import { IPSUIEngineParam } from '../../view/ipsuiengine-param';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSAppDEViewEngineImplBase
  extends PSModelObjectImpl
  implements IPSAppViewEngine
{
  get engineCat(): string {
    return this.M.engineCat;
  }

  get engineType(): string {
    return this.M.engineType;
  }

  protected psuiengineparams: IPSUIEngineParam[];
  getPSUIEngineParams(): IPSUIEngineParam[] | null {
    return (
      this.psuiengineparams ||
      (this.psuiengineparams = this.fillChildListModel(
        this.M.getPSUIEngineParams,
        S._1d,
      ) as IPSUIEngineParam[])
    );
  }

  findPSUIEngineParam(objKey: any): IPSUIEngineParam | null {
    return this.getPSModel5(
      S._1d,
      this.getPSUIEngineParams(),
      objKey,
    ) as IPSUIEngineParam;
  }
}
